package cn.eli.vue.mapper.artical;

import cn.eli.vue.entity.Artical;
import cn.eli.vue.entity.LikeArtical;
import cn.eli.vue.entity.SubscribeArtical;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ArticalMapper {
    /*发布文章*/
    int ArticalPost(@Param("user_id")int user_id,@Param("artical_title")String artical_title,@Param("artical_discribe")String artical_discribe,
                    @Param("artical_img")String artical_img);
    /*修改文章*/
    int ArticalModify(@Param("artical_id")int artcal_id,@Param("artical_title")String artical_title,@Param("artical_discribe")String artical_discribe,
                    @Param("artical_img")String artical_img);
    /*评论文章*/
    int ArticalComment(@Param("artical_id")int artical_id,@Param("user_id")int user_id,@Param("commentArtical_discribe")String commentArtical_discribe);
    /*收藏文章*/
    int ArticalSubscribeInsert(@Param("artical_id")int artical_id,@Param("user_id")int user_id);
    /*收藏文章*/
    int ArticalSubscribeUpdate(@Param("artical_id")int artical_id,@Param("user_id")int user_id);
    /*取消收藏文章*/
    int ArticalSubscribeCancelDelete(@Param("artical_id")int artical_id,@Param("user_id")int user_id);
    /*取消收藏文章*/
    int ArticalSubscribeCancelUpdate(@Param("artical_id")int artical_id,@Param("user_id")int user_id);
    /*点赞文章*/
    int ArticalLikeInsert(@Param("artical_id")int artical_id,@Param("user_id")int user_id);
    /*点赞文章*/
    int ArticalLikeUpdate(@Param("artical_id")int artical_id,@Param("user_id")int user_id);
    /*取消点赞文章*/
    int ArticalLikeCancelDelete(@Param("artical_id")int artical_id,@Param("user_id")int user_id);
    /*取消点赞文章*/
    int ArticalLikeCancelUpdate(@Param("artical_id")int artical_id,@Param("user_id")int user_id);
    /*获取所有的文章*/
    List<Artical> AllArtical();
    /*获取某个用户的所有文章*/
    List<Artical> AllArticalInUser(@Param("user_id")int user_id);
    /*获取某个用户点赞的文章*/
    List<LikeArtical> AllArticalInLike(@Param("user_id")int user_id);
    /*获取某个用户收藏的文章*/
    List<SubscribeArtical> AllArticalInSubscribe(@Param("user_id")int user_id);
    /*从id获取实体*/
    Artical ArticalIdToArtical(@Param("artical_id")int artical_id);
}
